﻿namespace ClassLibrary.BusinessLayer.Facade
{
    using ClassLibrary.BusinessLayer.BusinessObjects;
    using ClassLibrary.DataLayer.DataObjects;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.Common;

    [DataObject(true)]
    public class AgentsFacade
    {
        private IAgentsDAO agentDAO = DAOAccess.AgentsDAO;

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public bool AddAgents(Agents clsAgents)
        {
            return this.agentDAO.InsertAgents(clsAgents);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public int AddAgentsAndReturnIdentity(Agents clsAgents)
        {
            return this.agentDAO.InsertAgentsReturnIdentity(clsAgents);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public string AddAgentsAndReturnOutput(Agents clsAgents)
        {
            return this.agentDAO.InsertAgentsReturnOutput(clsAgents);
        }

        [DataObjectMethod(DataObjectMethodType.Delete)]
        public bool DeleteAgents(Agents clsAgents)
        {
            return this.agentDAO.DeleteAgents(clsAgents);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Agents> GetAgents(Agents clsAgents)
        {
            return this.agentDAO.GetAgents(clsAgents);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Agents> GetAgents(string agent)
        {
            Agents clsAgents = new Agents();
            clsAgents._Agent = agent;
            return this.agentDAO.GetAgents(clsAgents);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Agents> GetsAgents()
        {
            return this.agentDAO.GetsAgents();
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public DataTable GetsAgents(string SPName, DbParameter[] param)
        {
            return this.agentDAO.GetsAgents(SPName, param);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Agents> ListAgents(Agents clsAgents)
        {
            return this.agentDAO.ListAgents(clsAgents);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<Agents> ListAgents(string agent)
        {
            Agents clsAgents = new Agents();
            clsAgents._Agent = agent;
            return this.agentDAO.ListAgents(clsAgents);
        }

        [DataObjectMethod(DataObjectMethodType.Update)]
        public bool UpdateAgents(Agents clsAgents)
        {
            return this.agentDAO.UpdateAgents(clsAgents);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public int UpdateAgents(string SPName, DbParameter[] param)
        {
            return this.agentDAO.UpdateAgents(SPName, param);
        }
    }
}

